Building and Running Simulations This chapter describes the options available in CompuRoc for the specification and execution of flight simulation profiles. The organization of this chapter follows the organization of the on-screen menus displayed by CompuRoc. This includes all operations except those related to thrust curve editing and history files, which are discussed separately in subsequent chapters. Described in sucession below are the items from the 'File', 'Edit', 'Events', and 'Display' menus, along with any keyboard or mouse-controlled equivalents. Following the menu descriptions are notes on data entry and running. • File menu Items from the 'File' menu are concerned with opening, closing, printing and saving documents on disk. These have the standard functions common to most Macintosh applications. New This item is enabled when no simulation document is currently open. Selecting it opens a new simulation initially named 'Untitled'. The Launch Data dialog box (see description below) is presented in order to accept startup information for the new simulation. Equivalent : from keyboard, type ⌘ -N. Open This item is enabled when no simulation document is currently open. Selecting it opens a previously saved simulation profile. The document to be opened is selected via the standard Macintosh file selection dialog (sometimes referred to as the 'Minifinder'). The simulation status window is presented displaying the selected profile. From this point the profile may be run and/or edited. Equivalent : from keyboard, type ⌘ -O. Close This item is enabled when a simulation document is currently open. Selecting it closes the current simulation. Since only one simulation may be open at a time, 'Close' must be selected in order to open a new or other previously saved profile, or in order to switch modes to thrust curve editing. The user is prompted to save any unsaved changes before closing. Equivalent : click the close box in the upper left corner of the simulation profile window or type ⌘ -W. Save Save the current simulation profile to disk along with any changes that have been made since the last save. If this is the first save of a new profile, the user is prompted to name the new document. Equivalent : from keyboard, type ⌘ -S. Save As... Save the current simulation profile to disk as a document different from the current one. The user is prompted to name the new document, and if it is different from the original, the original is left unchanged from its last saved state. Revert Undo any changes made to the current profile and revert to the last saved state. Since this operation is irreversible, the user is asked to confirm the selection. New Thrust Curve Open Thrust Curve These menu items deal with editing of motor thrust curves; they are dealt with in detail in the next chapter. Save As Text Load Text File These menu items are used to read and write ASCII standard text files containing either flight history data or motor thrust curves; their use is also discussed later. Tracking Reduction... This menu item calls up a calculator dialog for performing two-station altazimuth tracking altitude data reduction. It is handy for on-the-range computation of tracked altitudes and closures. Details are given later in this manual. Page Setup... Print Graph Graphs of the simulation output (see below) can be printed, as well as viewed on-screen. These menu items control printer setup and printing, and work as with any other printing Macintosh application. Quit Close the current simulation and exit CompuRoc, returning control to the Finder. The user is prompted to save any unsaved changes before quitting. Equivalent: from keyboard, type ⌘ -Q. • Edit menu Items from the 'Edit' menu are all disabled, with the exception of 'Clear'. Clear Remove the currently highlighted event from the profile. Nothing is saved to the 'clipboard'. All events following the removed event are moved up to close the "hole". Equivalent: from keyboard, type (on newer Mac keyboards, this key is labeled delete). • Events menu Items from the 'Events' menu are concerned with the definition and changing of events which make up a simulation profile. Also, the menu includes items which may be used to control running of the simulation. These menu items may be easier to get at than the main window controls when a display window is active. Insert Burn Insert a new 'burn' type event in the place of the currently highlighted event. The initially highlighted event and all following events are moved down to accommodate the insertion. The thrust curve defining the burn is selected by the user via the standard Macintosh 'Minifinder' file selection dialog(see details below). Equivalent : from keyboard, type ⌘ -B. Insert Delay Insert a new 'delay' type event in the place of the currently highlighted event. The initially highlighted event and all following events are moved down to accommodate the insertion. The user is prompted for delay parameters (see details below). Equivalent : from keyboard, type ⌘ -D. Change Reopen the highlighted event in order to change or examine parameters (see details below). If this option is selected for an empty event slot, CompuRoc appends a new event to the profile. In that case, the user is asked via a dialog box whether to add a burn or delay event. Equivalent : double-click on desired event (or empty slot) in profile grid. Start Run Begin calculations from t=0 on a new or stopped simulation. Restart a paused simulation at the point of suspension. This item (and the corresponding button) are enabled only when a simulation is loaded (with at least one post-launch event) and is not running. Equivalents : from keyboard, type ⌘ -G; in simulation window, click 'Start' button. Pause Run Suspend calculations temporarily. This option is useful for examining results during a run and then resuming without starting over. This item (and the corresponding button) are enabled only when a simulation is running. Equivalents: from keyboard, type ⌘ -P; in simulation window, click 'Pause' button. Stop Run End simulation calculations. This option halts the simulation at any time prior to the predetermined end. After stopping, the flight history still remains in memory and can be displayed or saved until such time as another simulation is started. Equivalents : from keyboard, type ⌘ -. ; in simulation window, click 'Stop' button. Play Sounds Toggle on and off the sound effects associated with the simulated flight. • Graph menu Items in the 'Graph' menu call up graphical displays of the current simulated flight profile. Figure 3 shows a typical display plot, obtained by selecting 'Altitude vs. time' from this menu. The display windows are moveable (by dragging the title bar) and resizeable and may be placed behind the main simulation window or any desk accessory windows that may be open. A display window may be called up at any time during a running, paused or stopped simulation. Only one display window may be open at a time. Selecting another while a display is already active simply replaces the old display with the new selection. Also, the scales and sizes of the display windows are selectable.   Fig. 3 - Simulation Display Window Altitude vs. time The vertical scale is altitude in meters, and the horizontal scale is elapsed time in seconds. The default displayed range is 500 meters and 42 seconds. Downrange vs. time The vertical scale is horizontal distance in meters, and the horizontal scale is elapsed time in seconds. The default displayed range is ±280 meters and 42 seconds. Altitude vs. downrange The vertical scale is altitude in meters, and the horizontal scale is horizontal distance in meters. The default displayed range is 500 meters and ±460 meters. Vertical rate vs. time The vertical scale is vertical velocity in meters per second, and the horizontal scale is elapsed time in seconds. The default displayed range is ±140 m/s and 42 seconds. Downrange rate vs. time The vertical scale is horizontal velocity in meters per second, and the horizontal scale is elapsed time in seconds. The default displayed range is ±140 m/s and 42 seconds. Vertical rate vs. downrange rate The vertical scale is vertical velocity in meters per second, and the horizontal scale is horizontal velocity in meters per second. The default displayed range is ±140 m/s and ±140 m/s. Select Scaling... Customize the scaling of the graph axes. The interval between grid ticks can be varied between 2 and 500 meters for distances, and between 2 and 60 meters/sec for velocities. Equivalent : from keyboard, type ⌘ -Y. Show Summary Display a dialog summarizing the important "milestones" of a completed simulation. Listed are maximum altitude, velocity, Mach number, acceleration, velocity leaving the launch rod, starting and minimum masses, time of last application of thrust and the best length of delay (for minimum deployment speed). There is also the option available to print this summary. Equivalent : from keyboard, type ⌘ -H. • Launch data entry The launch data entry dialog box (Figure 4) is displayed when the 'Launch' slot in the event grid is opened, or when a new simulation document is opened. This dialog box contains editable fields for entry of startup data, as well as 'button' and 'check box' controls. Since this is a "modal dialog box", no menu or other incidental operations can be performed until the dialog box is dismissed. Clicking the 'OK' button enters the displayed values in the current simulation definition. Clicking the 'Cancel' button causes any changes made in the dialog box to be discarded, and the previously entered values (if any) to be retained.   Fig. 4 - Launch Data Entry Dialog The values defined in this dialog correspond to the liftoff configuration of the rocket flight. The following notes apply to specific launch data entries: Rocket mass - This value should reflect the full mass of the rocket less engines at the moment of ignition. The rocket remains motionless on the pad until the thrust exceeds the weight (mass ¥ grav. acc.). The mass must be greater than zero or the simulation will not run. Reference area / diameter and drag coefficent - These values define the drag forces acting on the rocket in flight. CompuRoc assumes the standard drag law in which the drag force is proportional to drag coefficient, CD, the reference area, A, and the square of the velocity, V (at subsonic speeds). Here A is taken to be the cross-sectional area of the rocket (usually perpendicular to the direction of flight and at the widest section of the airframe). Using the pop-up menu, you can choose either to enter the area directly, or simply to enter a body tube diameter and have CompuRoc calculate the area for you. V is the velocity with respect to still air. CD is the dimensionless drag coefficient. The model rocket rule of thumb is that CD usually lies near 0.75 for average layouts and surface finishes. One possible use for CompuRoc is the comparison of actual flight data with simulations to determine CD for a variety of designs (see Examples). Zero values for area or drag coefficient are permissible for simulating drag-free flights (e.g. for all you folks who fantasize about flying rockets on the moon!) but negative values will be rejected. Profile - When the velocity of the rocket begins to approach the speed of sound, the subsonic drag approximation begins to break down. CompuRoc automatically detects this and takes it into account, using one of two models for supersonic drag divergence. Rockets with a sharply pointed nose cone have different drag characteristics at transonic speeds than do blunt-nosed rockets (see the Technical Appendix for more details). Select the appropriate choice from the pop-up menu. If the flight never approaches supersonic speed, then the selection here has no effect. If you wish to neglect transonic effects entirely, choose 'subsonic only'. Launch Angle - This value specifies the angle from vertical (straight up) at which the flight begins. Positive angles correspond to aiming in the positive downrange direction. Launcher length - This value defines the altitude to which the rocket is constrained to fly in a straight line before "flying free". This parameter is fairly important in simulations which involve winds and/or low thrust/weight ratio rockets. For a rocket which gets up and off the pad fairly fast, it's OK to use a "realistic" launcher length of a meter or two. A slow-moving model however, may well leave the launch rod at a speed which is of the same order as the ambient wind speed. CompuRoc always points the thrust vector of the simulated rocket into the instantaneous "relative wind", so such a simulation will immediately execute a severe "weathercock" into the wind. Since most real rockets are somewhat more sluggish in responding to aerodynamic forces, this may provide a poor simulation of the actual flight. In such cases one can enter a larger value for the launcher length (perhaps several tens of meters) in an effort to take into account the finite time it takes the rocket to aim itself into the wind. Of course, such an approach is not rigorous but it can give at least a qualitative feeling for the importance of dynamic stability considerations in various weight/thrust/wind regimes. The 'Show Summary' option under the 'Graph' menu gives the rocket's velocity as it leaves the launch rod; this information may be helpful in determining the appropriateness of a particular rod length. Stopping conditions - The pop-up menu is used to select when to end the simulation. The choices are to stop at maximum altitude, at ground level, or at a specified number of seconds after launch. These stopping conditions are overriden by the 'Stop' menu/button controls. Atmospheric conditions - The drag force and air density used in calculations are determined by several factors. These include temperature, sea level barometric pressure, elevation above sea level, and wind speed. Using the 'atmosphere' pop-up menu, choose between no atmosphere (vacuum), atmospheric density which is uniform throughout the flight (constant density), and density which falls off with altitude according to a standard model (standard lapse; see Appendix for details). You can choose to specify either the temperature as measured at the launch site elevation, or at sea level (if it is different). CompuRoc will use the information given to figure out the air density at the location of the rocket. The temperature is entered in degrees Celsius, and cannot be less than absolute zero (that's -273° C ; shouldn't be of too much practical interest except to Minnesota rocketeers!). Pressure is given in millibars (corrected to sea level as the Weather Service usually provides it), and elevation is in meters. Wind velocity is entered in meters per second, and is defined as positive for wind blowing toward the positive x-direction. Gravitational acceleration - Another item for those of you interested in alternate worlds; the value of g in m/sec**2 may be specified. (Notes on entry of numerical data: Experienced Macintosh users will be familiar with the entry of values in the editable text fields of this and other dialog boxes. This description is for the benefit of those not familiar with the technique. The text insertion point is positioned anywhere in an edit field by clicking there with the mouse cursor. Text entered from the keyboard is inserted at this point. Dragging, shift-clicking, or double-clicking in a field selects and highlights a range of text. Text entered when a range is selected replaces the selection. Be sure to replace a value you want to change, rather than just typing until the old value scrolls out of view. The old number will still be there, even though you can't see it! Hitting the 'tab' key causes the selection to jump to the next item in the dialog. ) • Thrust curve selection The burn entry dialog box (Figure 5) appears when a burn-type event is opened or created in the simulation event grid. In the latter case, the user is first prompted (via a file selection Minifinder) to specify a thrust curve file. After the selection, or upon opening a previously defined burn event, this modal dialog box appears. Cluster factor - The thrust of the specified engine will be multiplied by this factor during the simulation (negative values could be interesting for studying retrorocket braking!). This factor also multiplies the engine's propellant mass, which is the amount by which the rocket's mass decreases during an engine's burn. For more information, see the chapter on "Editing Thrust Curves". Engine type - The currently specified thrust curve is identified here by the name of the corresponding thrust file. If you wish to change the specified engine, double-click on the displayed name and a thrust file selection dialog will be displayed. This is a short-cut for the longer procedure of deleting the original burn event, and then inserting a new one. (Note : Users of the original version of CompuRoc (1.x) will recall that in order for the simulation to run, all specified thrust curves had to be in the same desktop folder as the simulation document. This is no longer true , since in CompuRoc 2.0 all thrust data is stored in the simulation document. However, this also means that old documents created with the older version of the program definitely will not work with CompuRoc 2.0! The same is true of old-version thrust curve files.)   Fig. 5 - Burn Entry Dialog As usual, the burn data dialog can be dismissed with either the 'OK' or 'Cancel' button. The former choice accepts any changes that may have been made to the event status while the latter discards any such modifications. • Delay data entry The delay data entry dialog box (Figure 6) is displayed upon opening or creating a delay-type simulation event. A "delay" is a more general purpose event than its name might at first suggest. A delay may be used not only to insert a non-propulsive interval in the flight profile, but also to effect changes in the rocket's mass and drag form factor. This allows for the easy modeling of staged flights and other rockets of time-variable configuration. The first parameter in the delay dialog is the delay duration in seconds. This value may be positive for actual delays, or zero for abrupt changes in mass or drag. The mass burnoff is entered in grams, and is total mass loss over the length of the delay. For non-zero durations, the mass is assumed to "burn off" at a constant linear rate during the delay. The drag coefficient and reference area/diameter are by default assumed to remain unchanged from their state just before the delay. In order to specify a change in these quantities, the corresponding dialog check boxes must be checked. In that case, the new drag values take effect, becoming the new defaults. For delays of non-zero duration, the new drag values take effect at the start of the delay interval. Again, any entries or changes made during the appearance of the delay dialog are retained or discarded by clicking the 'OK' or 'Cancel' buttons respectively.   Fig. 6 - Delay Data Entry Dialog • Running Simulations After the event data for a simulation have been defined, the calculation run may be started. As noted above, this is accomplished via either menu, button or keyboard controls. During the run, the current simulation time, position, and velocity are updated each 0.1 second of simulated time. The speed of execution will depend upon the specific type of Macintosh computer you are running. The 'original' Macintoshes based on the Motorola 68000 microprocessor run somewhat slowly, and the simulation on these machines actually takes longer than real time. The faster 680x0-based Macintosh models run considerably faster, and if your computer has floating-point hardware (FPU), CompuRoc will automatically sense this and take advantage of it. (The current version of CompuRoc 2.0 will also run very quickly on PowerPC-based Macintoshes, although this is operating in emulation rather than in native PowerPC mode.) Included on the CompuRoc distribution disk is a folder containing a library of thrust curves for a variety of NAR certified model rocket engines and other high-power motors. These thrust curves should be useful for constructing simulations of many flight scenarios. A reasonable attempt has been made to make CompuRoc immune to entry of nonsensical data, however it is still possible to force-feed the program numbers that will upset it. In general, CompuRoc will trap most non-physical values of such parameters as mass, density, pressure and so on. Also, it should be borne in mind that CompuRoc has been written specifically for subsonic and near-transonic rocketry application, and is most useful and accurate when used in that context. Still, some will find it hard to resist the temptation to see how far they could send their little brother on a cluster of a hundred G25's. Fine, but just remember the principle of G.I.G.O. -- Garbage In, Garbage Out!